package model

import (
	"gorm.io/gorm"
	"time"
)

type LiveRoom struct {
	Id        uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
	Title     string         `gorm:"column:title;type:varchar(255);comment:标题;not null;" json:"title"`                         // 标题
	Info      string         `gorm:"column:info;type:varchar(255);comment:简介;not null;" json:"info"`                           // 简介
	FileUrl   string         `gorm:"column:file_url;type:varchar(255);comment:文件地址;not null;" json:"file_url"`                 // 文件地址
	DamuNum   uint           `gorm:"column:damu_num;type:bigint(20) UNSIGNED;comment:弹幕量;not null;default:0;" json:"damu_num"` // 弹幕量
	UserId    uint           `gorm:"column:user_id;type:bigint(20) UNSIGNED;comment:用户id;not null;default:0;" json:"user_id"`  // 用户id
}

func (lr *LiveRoom) TableName() string {
	return "live_room"
}
